#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

void Init(int arr[], int n)
{
	int i = 0;
	for (i = 0; i < n; i++)
	{
		arr[i] = 0;
	}
}

void Print(int arr[], int n)
{
	int i = 0;
	for (i = 0; i < n; i++)
	{
		printf("%2d ", arr[i]);
	}
	printf("\n");
}

void Reverse(int arr[], int n)
{
	int l = 0;
	int r = n - 1;
	while (l < r)
	{
		int temp = arr[l];
		arr[l] = arr[r];
		arr[r] = temp;
		l++;
		r--;
	}
}

void Tran(int arr1[], int arr2[], int n)
{
	int i = 0;
	for (i = 0; i < n; i++)
	{
		int temp = arr1[i];
		arr1[i] = arr2[i];
		arr2[i] = temp;
	}

}
int main()
{
	int arr[10] = { 1,2,3,4,5,6,7,8,9,10 };
	int n = sizeof(arr) / sizeof(arr[0]);
	Print(arr, n);
	Reverse(arr, n);
	Print(arr, n);
	Init(arr, n);
	Print(arr, n);
	
	int arr1[5] = { 1,3,5,7,9 };
	int arr2[5] = { 2,4,6,8,10 };
	int sz = sizeof(arr1) / sizeof(arr1[0]);
	Print(arr1, sz);
	Print(arr2, sz);
	Tran(arr1, arr2, sz);
	Print(arr1, sz);
	Print(arr2, sz);

	return 0;
}